<!DOCTYPE html>
<html lang="en">
<head>
    <title id="Description">This demo showcases the jqxComplexInput change event.</title>
    <meta name="description" content="This demo showcases the jqxComplexInput change event." />
    <link type="text/css" rel="Stylesheet" href="../../jqwidgets/styles/jqx.base.css" />
    <script type="text/javascript" src="../../scripts/jquery-1.11.1.min.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxscrollbar.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxbuttons.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxpanel.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxcomplexinput.js"></script>
    <script type="text/javascript" src="../../scripts/demos.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#jqxComplexInput").jqxComplexInput({ width: 300, height: 25, value: "15 + 7i", spinButtons: true });

            $("#eventsPanel").jqxPanel({ width: 300, height: 150 });

            $("#jqxComplexInput").on("change", function (event) {
                var args = event.args;
                if (args) {
                    var value = args.value;
                    var oldValue = args.oldValue;
                    var realPart = args.realPart;
                    var imaginaryPart = args.imaginaryPart;
                    $("#eventsPanel").jqxPanel("append", "<strong>" + event.type + "</strong><br />" +
                        "value: " + value + ", old value: " + oldValue +
                        ",<br /> real part: " + realPart + ", imaginary part: " + imaginaryPart + "<br />");
                }
            });
        });
    </script>
</head>
<body>
    <div id="jqxComplexInput">
        <input type="text" />
        <div>
        </div>
    </div>
    <div style="margin-top: 20px;">
        Events log:</div>
    <div id="eventsPanel">
    </div>
</body>
</html>